package com.yunsom.testdemo.design.command;

/**
 * @author Xbao
 * @description 命令模式
 * @date 2022/6/7 16:25
 */
public class CommandTest {

  public static void main(String[] args) {
    Stock beer = new Stock();

    BuyStock buyStockOrder = new BuyStock(beer);
    SellStock sellStockOrder = new SellStock(beer);

    Broker broker = new Broker();
    broker.takeOrder(buyStockOrder);
    broker.takeOrder(sellStockOrder);

    broker.placeOrders();
  }
}
